fix: rebase design-audit regression hardening onto current main#847
fix: rebase design-audit regression hardening onto current main#847BigSimmo wants to merge 2 commits into
Conversation
|
Updates to Preview Branch (codex/design-audit-main-merge-clean-20260718) ↗︎
Tasks are run on every commit but only new migration files are pushed.
❌ Branch Error • Sat, 18 Jul 2026 12:37:12 UTC View logs for this Workflow Run ↗︎. |
📝 WalkthroughWalkthroughThe PR adds caller-abort propagation to RAG classifier and RPC operations, instruments answer coalescing, relocates dashboard search matches, updates focus and search-parameter handling, adjusts Playwright behavior, and refreshes UI, audit, navigation, and schema regression expectations. ChangesRAG cancellation and observability
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/rag-candidate-sources.ts`:
- Around line 91-104: Update both call sites of callVersionedRetrievalRpc in
rag.ts, including the parallel hybrid RPC and vector-fallback RPC paths, to pass
the active cancellation signal through the signal parameter. Preserve all
existing arguments and behavior while ensuring search cancellation reaches both
retrieval callers.
In `@tests/ui-accessibility.spec.ts`:
- Line 51: Align the H1 assertions with the dashboard’s rendered “Clinical
Guide” heading, or update the source heading contract consistently if “Clinical
KB” is intended. Apply the same correction at tests/ui-accessibility.spec.ts
lines 51-51, tests/ui-smoke.spec.ts lines 876-876, and tests/ui-smoke.spec.ts
lines 1271-1271.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c8558666-2437-4762-af11-c2171939fa02
📒 Files selected for processing (13)
playwright.config.tssrc/app/page.tsxsrc/components/ClinicalDashboard.tsxsrc/components/route-error-boundary.tsxsrc/lib/rag-candidate-sources.tssrc/lib/rag.tssupabase/drift-manifest.jsontests/audit-content-services-regressions.test.tstests/audit-navigation-auth-regressions.test.tstests/supabase-schema.test.tstests/ui-accessibility.spec.tstests/ui-smoke.spec.tstests/ui-tools.spec.ts
| signal?: AbortSignal, | ||
| ): Promise<{ data: T | null; error: SupabaseRpcError }> { | ||
| const client = supabase as unknown as { | ||
| rpc: (name: string, rpcArgs: Record<string, unknown>) => Promise<{ data: T | null; error: SupabaseRpcError }>; | ||
| const client = supabase as unknown as SupabaseRpcClient; | ||
| const executeRpc = async (name: string, rpcArgs: Record<string, unknown>) => { | ||
| const pending = client.rpc(name, rpcArgs) as AbortableRpc<T>; | ||
| const pendingWithAbort = | ||
| signal && typeof pending.abortSignal === "function" ? pending.abortSignal(signal) : pending; | ||
| return await pendingWithAbort; | ||
| }; | ||
| const versioned = await client.rpc(versionedName, args); | ||
| const versioned = await executeRpc(versionedName, args); | ||
| if (versioned && !isMissingRetrievalRpcError(versioned.error)) return versioned; | ||
| const legacyArgs = { ...args }; | ||
| delete legacyArgs.include_public; | ||
| const ownerResult = await client.rpc(legacyName, legacyArgs); | ||
| const ownerResult = await executeRpc(legacyName, legacyArgs); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Thread the new cancellation signal through every retrieval caller.
callVersionedRetrievalRpc now accepts signal, but the two existing callers in src/lib/rag.ts (Lines 2837-2849 and 2945-2956) still omit it. Search cancellation therefore does not reach either the parallel hybrid RPC or the vector-fallback RPC.
Proposed fix
callVersionedRetrievalRpc(
supabase,
"...",
"...",
{
// existing arguments
},
+ args.signal,
);Apply this to both call sites.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/lib/rag-candidate-sources.ts` around lines 91 - 104, Update both call
sites of callVersionedRetrievalRpc in rag.ts, including the parallel hybrid RPC
and vector-fallback RPC paths, to pass the active cancellation signal through
the signal parameter. Preserve all existing arguments and behavior while
ensuring search cancellation reaches both retrieval callers.
|
|
||
| async function expectDashboardUsable(page: Page) { | ||
| await expect(page.getByRole("heading", { level: 1, name: "Clinical Guide" })).toHaveCount(1); | ||
| await expect(page.getByRole("heading", { level: 1, name: "Clinical KB" })).toHaveCount(1); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Align all H1 assertions with the dashboard’s rendered heading. The supplied dashboard still renders Clinical Guide at src/components/ClinicalDashboard.tsx Line 3495, while all three changed tests require Clinical KB.
tests/ui-accessibility.spec.ts#L51-L51: update the source heading/title contract or assertClinical Guide.tests/ui-smoke.spec.ts#L876-L876: apply the same corrected H1 expectation.tests/ui-smoke.spec.ts#L1271-L1271: apply the same corrected H1 expectation.
📍 Affects 2 files
tests/ui-accessibility.spec.ts#L51-L51(this comment)tests/ui-smoke.spec.ts#L876-L876tests/ui-smoke.spec.ts#L1271-L1271
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/ui-accessibility.spec.ts` at line 51, Align the H1 assertions with the
dashboard’s rendered “Clinical Guide” heading, or update the source heading
contract consistently if “Clinical KB” is intended. Apply the same correction at
tests/ui-accessibility.spec.ts lines 51-51, tests/ui-smoke.spec.ts lines
876-876, and tests/ui-smoke.spec.ts lines 1271-1271.
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #3269 (success). Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
Pull request was closed
Summary
mainfrom a clean branch.AlsoMatcheslayout ordering, RAG retrieval cancellation/error typing hardening, and updated drift manifest expectations for current replay behavior.Verification
npm run verify:cheap(not run: localnode_modulesis not bootstrapped in this environment)npm run verify:ui(not run: local browser/test toolchain not available in this environment)npm run verify:ui) in this environment.npm run check:pr-local(not run: requires local Playwright + full repo dependencies)npm run check:production-readiness(not run: includes provider/clinical governance checks)Risk and rollout
Risk: high - this PR touches clinical/RAG route behavior and navigation error handling, where regressions can impact user trust and answer routing integrity.
Rollback: revert this PR to restore pre-change behavior immediately.
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)